import request from '@/sheep/request';

export function pageList(data) {
	return request({
		url: '/erp/purchase-order/page',
		method: 'get',
		data: data
	})
} 

// 获取产品信息
export function getProducts(data) {
	return request({
		url: '/erp/product/simple-list',
		method: 'get',
		data: data
	})
}
// 获取产品信息
export function getProductCount(data) {
	return request({
		url: '/erp/stock/get-count',
		method: 'get',
		data: data
	})
}
// 获取产品信息
export function createSaleOrder(data) {
	return request({
		url: '/erp/purchase-order/create',
		method: 'post',
		data: data
	})
}
// 更新产品信息
export function updateSaleOrder(data) {
	return request({
		url: '/erp/purchase-order/update',
		method: 'PUT',
		data: data
	})
}// 更新销售订单的状态
export function updateSaleOrderStatus(id,status) {
	return request({
		url: '/erp/purchase-order/update-status',
		method: 'PUT',
		params: { id, status }
	})
} 
// 获取产品信息
export function getOrderDetails(id) {
	return request({
		url: '/erp/purchase-order/get?id=' + id,
		method: 'get'
	})
}


// 删除订单信息
export function deleteOrders(id) {
	return request({
		url: '/erp/purchase-order/delete?ids=' + id,
		method: 'delete'
	})
}
// 统计采购订单信息
export function purchaseCount() {
	return request({
		url: '/erp/purchase-statistics/summary',
		method: 'get'
	})
}
// 统计销售订单信息
export function saleCount() {
	return request({
		url: '/erp/sale-statistics/summary',
		method: 'get'
	})
}